﻿<%@ Page Language="C#" AutoEventWireup="true" 
CodeBehind="NotaIngresoInsertForm.aspx.cs" 
Inherits="UILGestion.AlmacenAdmin.NotaIngresoInsertForm" %>
<%@ Register assembly="WebLib" namespace="WebLib" tagprefix="cc1" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%--<%@ Register assembly="EstandarControl" namespace="EstandarControl" tagprefix="lib" %>--%>
<%@ Register src="~/Control/menuCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>

<%@ Import Namespace="System.Web.Script.Services" %>
<%@ Import Namespace="System.Web.Services" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/main.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/NotaIngreso.js" type="text/javascript"></script>
    <script src="../Scripts/SearchResult.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/theme.css" />
    <title>NOTA DE INGRESO</title>
    </head>

    <script>
        function LoadTab(tabname,ruta,titulo,ico) {
           
            var mainTabStrip = parent.parent.Ext.getCmp('RegionPanel1_mainRegion_mainTabStrip');
            var tabID = tabName; // data[8];
            var tab = parent.parent.Ext.getCmp(tabID);

            loadTab(mainTabStrip, tab, tabID, ruta, titulo, ico);
    


        }
</script>
    
    <body>
        <form id="form1" runat="server" autocomplete="off">
                            
            <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true"  
                    EnablePartialRendering="true">
                    </asp:ToolkitScriptManager>
                   
                   <asp:Panel ID="pnlMain" runat="server" Visible="false"
                   CssClass="Heading secTitle AreaHeading ms-crm-List-Header "   >
       
         <asp:Label ID="Label1" runat="server" Text="NOTA DE INGRESO" 
             style="font-size: large; color: #960818"></asp:Label>
              
             </asp:Panel>  
              <asp:Panel ID="PanelButtom" runat="server" Visible="false"    class="ms-crm-Form-Body" >

              <input id="idObra" type="hidden" runat="server" />
       <input id="internalid" type="hidden" runat="server" />
        <input id="type" type="hidden" runat="server" />
         <input id="idMotivo" type="hidden" runat="server" />
         <input id="idproveedor" type="hidden" runat="server" />
         <input id="idAlmacen" type="hidden" runat="server" />
         <input id="idNS" type="hidden" runat="server" />
       
       <input id="idColeccionList" type="hidden" runat="server" />
        <input id="idOC" type="hidden" runat="server" />

       

                   <table >
<tr>

<td>
    <asp:Button ID="saveButton" runat="server" Text="Guardar"  CssClass="ms-crm-List-Header"
       OnClick="btnContinue_OnClick"     /></td>
       
<td>
    <asp:Button ID="cancelarButton" runat="server" Text="Cancelar"  CssClass="ms-crm-List-Header"
       OnClick="btnContinue_OnClick" Width="80px" /></td>
       <td>
     <asp:Button ID="refreshButton" runat="server" Text="Restablecer"  CssClass="ms-crm-List-Header"
        onclick="btnContinue_OnClick"  /></td>

        <td>
        <asp:Button ID="nuevoButton" runat="server" Text="Nuevo"  CssClass="ms-crm-List-Header"
        onclick="btnContinue_OnClick"  /></td>
     
                
                <td>
            

            &nbsp;</td><td>
            

           
    </td></tr></table>
 
         </asp:Panel>
                
    <asp:Panel ID="PanelBody" runat="server" Visible="false" BackColor="white" >
                  <table>
                      <tr>
                          <td align="right" valign="top" width="100px"  >
                               Numero: </td>
                          <td valign="top" width="300px" align="left">
                              <asp:Label ID="numDocumentoLabel" runat="server" Text="Label"></asp:Label>
                          </td>
                          <td align="right" valign="top" width="100px">
                               Motivo: </td>
                          <td valign="top" width="200px" align="left">
                              <asp:Label ID="motivoDropDownList" runat="server" Text=""></asp:Label>
                             
                          </td>
                      </tr>
                      <tr>
                      <td align="right" width="100px" valign="top"  >
                               &nbsp;</td>
                          <td width="300px" align="left">
                              &nbsp;</td>
                          
                          <td align="right" valign="top" width="100px" >
                              Fecha Recepcion:</td>
                          <td valign="top" width="200px" align="left">
                         
                              <cc1:Input ID="fechaEmisonTextBox"  runat="server" 
                                    ></cc1:Input>
                                   <asp:ImageButton runat="Server" ID="ImageButton2" 
                                        ImageUrl="~/Images/month.gif" 
                                        AlternateText="Click aqui para mostrar calendario" Width="16px" />
                                        <asp:CalendarExtender ID="CalendarExtender1" 
                                       runat="server"  
                                       TargetControlID="fechaEmisonTextBox"
                                       PopupButtonID="ImageButton2"
                                       
                                       ></asp:CalendarExtender>
                              
                          </td>
                      </tr>
                      <tr>
                         <td align="right" width="100px" valign="top"  >
                               Tipo documento: </td>
                          <td width="300px" align="left">
                             <cc2:DropDownCC ID="tipoDocDropDownList" runat="server"    
                                  Width="150px"></cc2:DropDownCC>
                              <br />
                          </td>
                          <td align="right">
                              
                               Fecha Documento: </td>
                          <td align="left">
                              <cc1:Input ID="fechadocumentoTextBox" runat="server"   
                                   ></cc1:Input>
                                  <asp:ImageButton runat="Server" ID="ImageButton1" 
                                        ImageUrl="~/Images/month.gif" 
                                        AlternateText="Click aqui para mostrar calendario" Width="16px" />
                                    <asp:CalendarExtender ID="CalendarExtender2" 
                                       runat="server"  
                                       TargetControlID="fechadocumentoTextBox"
                                       PopupButtonID="ImageButton1"
                                       
                                       ></asp:CalendarExtender>
                          </td>
                      </tr>
                      <tr>
                          <td align="right" valign="top" width="100px"  >
                               Numero: </td>
                          <td align="left" width="300px">
                              <cc1:Input ID="documentoTextBox" runat="server" Width="150px"  ></cc1:Input>
                          </td>
                          <td align="right">
                              &nbsp;</td>
                          <td align="left">
                              &nbsp;</td>
                      </tr>
                      <tr>
                          <td align="right" width="100px" valign="top"  >
                            
                          <asp:Label ID="provLabel1" runat="server" Text="Proveedor:" 
                                  ></asp:Label>
                              <br />
                              <asp:Label ID="tipocambLabel" runat="server"  Text="Tipo Cambio $:" 
                                  ></asp:Label>
                          </td>
                          <td width="300px" align="left">
   
   
                              <asp:Label ID="proveedorEditTextBox" runat="server" Text=""></asp:Label>
                     

                              <br />
                             
                               <cc2:PostTextBox ID="tipoCamInput" runat="server" DataType="Double"  Width="150px"
                                  ToolTip="Ingrese Tipo Cambio Dollar"></cc2:PostTextBox>
                            
                              </td>
                          <td align="right">
                              &nbsp;</td>
                          <td align="left">
                              &nbsp;</td>
                      </tr>
                      <tr>
                          <td align="right" valign="top" width="100px"  >
                                                            Observaciones: </td>
                          <td  colspan="3" align="left">
                              <cc2:PostTextBox ID="observacionTextBox" runat="server" 
                              TextMode="MultiLine" Width="400px"  ></cc2:PostTextBox>
                               
                          </td>
                         
                      </tr>
                  </table>

                  <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
                      <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Insumos">
                          <ContentTemplate>
                              <asp:UpdatePanel ID="ItemUpdatePanel" runat="server" UpdateMode="Conditional">
                       <ContentTemplate>
                      
                      
                      <asp:GridView ID="itemGridView" runat="server" AutoGenerateColumns="False" 
                              CellPadding="4" DataKeyNames="idInternal" 
                              onrowcancelingedit="CancelEditItem" 
                              onrowediting="EditItem" onrowupdating="UpdateItem"
                               SkinID="GridView"> <Columns> 
                               
                               <asp:TemplateField HeaderText="Documento Ref" ItemStyle-Width="95px">
                                      

                                      <ItemTemplate>
                                       <%--OnClientClick="script2(formulario,)" 
                                      script2(tabname,ruta,titulo,ico)--%>

                                     
                                      <asp:Hyperlink runat= "server"  ForeColor="Blue" 
                Text='<%# DataBinder.Eval(Container.DataItem,"descripcionRef").ToString()%>'  
                 Target="_self"  ID="OrdenCompra"
                NavigateUrl='<%# DataBinder.Eval(Container.DataItem,"formulario").ToString() %>' 
               />   


                                    
                                     
                                     </ItemTemplate>
                                     <EditItemTemplate>
                                       <cc1:Input ID="descripcionRefEditTextBox" runat="server" 
                                              BackColor="Transparent" ReadOnly="true" Text='<%# Eval("descripcionRef")%>' 
                                              Width="70px" />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                          

                                          <cc1:Input ID="descripcionRefInsertTextBox" runat="server" 
                                              BackColor="Transparent" ReadOnly="true" Width="70px" />
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:TemplateField HeaderText="Codigo" ItemStyle-Width="70px">
                                      

                                      <ItemTemplate>
                                          

                                          <asp:Label ID="codigoLabel" runat="server" Text='<%# Eval("codigo")%>'></asp:Label>
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <EditItemTemplate>
                                          

                                          <cc1:Input ID="codigoEditTextBox" runat="server" BackColor="Transparent" 
                                              ReadOnly="true" Text='<%# Eval("codigo")%>' Width="70px" />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                          

                                          <cc1:Input ID="codigoInsertTextBox" runat="server" BackColor="Transparent" 
                                              ReadOnly="true" Width="70px" />
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:TemplateField HeaderStyle-Width="450px" HeaderText="Descripcion">
                                      

                                      <ItemTemplate>
                                          

                                          <asp:Label ID="descripcionLabel" runat="server" 
                                              Text='<%# Eval("descripcion")%>'></asp:Label>
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <EditItemTemplate>
                                          

                                          <asp:Label ID="descripcionEditTextBox" runat="server" ReadOnly="true" 
                                              Text='<%# Eval("descripcion")%>' />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                         
                                          
 
                                          

                                         
                                          <cc1:Input ID="descripcionInsert1TextBox" runat="server" 
                                              BackColor="Transparent" ReadOnly="true" Width="0" />
                                          

                                          <cc1:Input ID="descripcionInsertTextBox" runat="server" backcolor="#DFE8F6" 
                                              DataType="List" method="GetRecursos" OnSelect="SelectRecursoInsert" Width="90%"></cc1:Input>
                                          

                                          <%--onchange="javascript:validarRecursoInsert(this);"--%>
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:TemplateField HeaderText="Unid.">
                                      

                                      <ItemTemplate>
                                          

                                          <asp:Label ID="unidadLabel" runat="server" Text='<%# Eval("unidad")%>' 
                                              Width="50"></asp:Label>
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <EditItemTemplate>
                                          

                                          <asp:Label ID="unidadEditTextBox" runat="server" Text='<%# Eval("unidad")%>' 
                                              Width="50px" />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                          

                                          <cc1:Input ID="unidadInsertTextBox" runat="server" BackColor="Transparent" 
                                              ReadOnly="true" Width="50px" />
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:TemplateField HeaderText="Cant. Orig" ItemStyle-HorizontalAlign="Right">
                                      

                                      <ItemTemplate>
                                          

                                          <asp:Label ID="cantidadOrigLabel" runat="server" BackColor="Transparent" 
                                              Text='<%# Eval("cantidadOrig")%>' />
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <EditItemTemplate>
                                          

                                          <cc1:Input ID="cantidadOrigEditTextBox" runat="server" backcolor="Transparent" 
                                              ReadOnly="true" Text='<%# Eval("cantidadOrig")%>' Width="75px" />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                          

                                          <cc1:Input ID="cantidadOrigInsertTextBox" runat="server" DataType="Double" 
                                              Width="75px" />
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:TemplateField HeaderText="Precio Unit" ItemStyle-HorizontalAlign="Right">
                                      

                                      <ItemTemplate>
                                          

                                          <asp:Label ID="precioUnitLabel" runat="server" BackColor="Transparent" 
                                              Text='<%# Eval("PrecioUnit")%>' />
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <EditItemTemplate>
                                          

                                          <cc1:Input ID="precioUnitEditTextBox" runat="server" DataType="Double" 
                                              Text='<%# Eval("PrecioUnit")%>' Width="75px" />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                          

                                          <cc1:Input ID="precioUnitInsertTextBox" runat="server" DataType="Double" 
                                              Width="75px" />
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:TemplateField HeaderText="Cant." ItemStyle-HorizontalAlign="Right">
                                      

                                      <ItemTemplate>
                                          

                                          <asp:Label ID="cantidadLabel" runat="server" BackColor="Transparent" 
                                              Text='<%# Eval("cantidad")%>' />
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <EditItemTemplate>
                                          

                                          <cc1:Input ID="cantidadEditTextBox" runat="server" DataType="Double" 
                                              onchange="javascript:calcularCantidadDisponible(this);" 
                                              Text='<%# Eval("cantidad")%>' Width="75px" />
                                          

                                      </EditItemTemplate>
                                  
                                      

                                      <%-- --%>
                                      

                                      <FooterTemplate>
                                          

                                          <cc1:Input ID="cantidadInsertTextBox" runat="server" DataType="Double" 
                                              onchange="javascript:calcularCantidadFootDisponible(this);" Width="75px" />
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                                  <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
                                      EditImageUrl="~/Images/edit.gif" ShowEditButton="True" 
                                      UpdateImageUrl="~/Images/update.gif" />
                                  

                                  <asp:TemplateField>
                                      

                                      <ItemTemplate>
                                          

                                          <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                              CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                                              OnClick="Deleteitem" OnClientClick="return confirm('Usted quiere eliminar?')" />
                                          

                                          <%--Text="&lt;img src=&quot;../Images/delete.gif&quot; /&gt;" --%>
                                          

                                      </ItemTemplate>
                                  
                                      

                                      <FooterTemplate>
                                          

                                          <asp:Button ID="btnAdd" runat="server" OnClick="AddNewItem" Text="Añadir" />
                                          

                                          <%--   Text="&lt;img src=&quot;../Images/up.gif&quot; /&gt;"--%>
                                          

                                      </FooterTemplate>
                                  
                                      

                                  </asp:TemplateField>
                                  

                              </Columns>
                              
                              

                          </asp:GridView>
                          
 
                          
                                  </ContentTemplate>
                                  
                      
                              </asp:UpdatePanel>
                              
 
                          </ContentTemplate>
                          
           

                   </asp:TabPanel>
                  </asp:TabContainer>
 </asp:Panel>



    
                              
   

    </form>
</body>
</html>
